<template>
  <a-spin :spinning="loading" :delay="300">
    <iframe :src="PDFUrl" class="contentFrame" :title="url" @load="loading = false" />
  </a-spin>
</template>

<script>

export default {
  name: 'PDFPreview',
  props: {
    url: {
      type: String,
      default: () => '',
    },
  },
  data() {
    return {
      loading: true,
    };
  },
  computed: {
    PDFUrl() {
      return `${window.global.PDF_URL}?file=${this.url}`;
    },
  },
  mounted() {
  },
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.contentFrame {
  width: 100%;
  border: none;
  height: 85vh;
  ::v-deep body {
    display: flex;
    justify-content: center;
  }
}
</style>
